/*package com.gopay.bis.bocom.ebank.operation;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.bocom.api.b2b.BOCOMB2BMiddlemanClient;
import com.bocom.netpay.b2cAPI.BOCOMB2CClient;
import com.gopay.bis.common.util.TransUtils;

public class BocomClientFactory {
    private final static Logger logger = LoggerFactory
            .getLogger("BocomClientFactory");
    private static  BOCOMB2CClient b2cClient;
    private static  BOCOMB2BMiddlemanClient b2bClient;

    private BocomClientFactory() {

    }

    public static BOCOMB2CClient getB2cClient(String b2cfilePath) {
//      if (b2cClient == null) {
            initB2cClient(b2cfilePath);
//      }
        return b2cClient;
    }

    public static BOCOMB2BMiddlemanClient getB2bClient(String b2bfilePath) {
        if (b2bClient == null) {
            initB2bClient(b2bfilePath);
        }
        return b2bClient;
    }

    private static void initB2cClient(String b2cfilePath){
        b2cClient = new BOCOMB2CClient();
        String certFilePath = TransUtils.getCanonicalFilePath(b2cfilePath);
        logger.info("BOCOM init B2C path:" + certFilePath);
        // 交行initialize方法只初始化一次再次调用直接返回，使用force_initialize方法
        int ret = b2cClient.force_initialize(certFilePath);
        if (ret != 0) {
            logger.info("BOCOM init B2C fail:" + b2cClient.getLastErr());
            b2cClient = null;
        }
    }

    private static void initB2bClient(String b2bfilePath){
        b2bClient = new BOCOMB2BMiddlemanClient();
        String certFilePath = TransUtils.getCanonicalFilePath(b2bfilePath);
        boolean ret = b2bClient.initalize(certFilePath);
        if (!ret) {
            logger.info("BOCOM init B2B fail:" + b2bClient.getLastErr());
            b2bClient = null;
        }
    }
}
*/